package com.taozi.question.service.Impl;

import com.taozi.common.utils.DateUtils;
import com.taozi.question.domain.SysInterview;
import com.taozi.question.mapper.SysInterviewMapper;
import com.taozi.question.service.ISysInterviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 面试Service业务层处理
 *
 * @author taozi
 * @date 2024-06-11
 */
@Service
public class SysInterviewServiceImpl implements ISysInterviewService {
    @Autowired
    private SysInterviewMapper sysInterviewMapper;

    /**
     * 查询面试
     *
     * @param id 面试主键
     * @return 面试
     */
    @Override
    public SysInterview selectSysInterviewById(Long id) {
        return sysInterviewMapper.selectSysInterviewById(id);
    }

    /**
     * 查询面试列表
     *
     * @param sysInterview 面试
     * @return 面试
     */
    @Override
    public List<SysInterview> selectSysInterviewList(SysInterview sysInterview) {
        return sysInterviewMapper.selectSysInterviewList(sysInterview);
    }

    /**
     * 新增面试
     *
     * @param sysInterview 面试
     * @return 结果
     */
    @Override
    public int insertSysInterview(SysInterview sysInterview) {
        sysInterview.setCreateTime(DateUtils.getNowDate());
        return sysInterviewMapper.insertSysInterview(sysInterview);
    }

    /**
     * 修改面试
     *
     * @param sysInterview 面试
     * @return 结果
     */
    @Override
    public int updateSysInterview(SysInterview sysInterview) {
        sysInterview.setUpdateTime(DateUtils.getNowDate());
        return sysInterviewMapper.updateSysInterview(sysInterview);
    }

    /**
     * 批量删除面试
     *
     * @param ids 需要删除的面试主键
     * @return 结果
     */
    @Override
    public int deleteSysInterviewByIds(Long[] ids) {
        return sysInterviewMapper.deleteSysInterviewByIds(ids);
    }

    /**
     * 删除面试信息
     *
     * @param id 面试主键
     * @return 结果
     */
    @Override
    public int deleteSysInterviewById(Long id) {
        return sysInterviewMapper.deleteSysInterviewById(id);
    }
}